
//               File: DynamicDataAdapterFactory
//        Description: No description for object
//             Author: DeKlarit - Language C# - Generator Version 10_1_3-31907 - Specifier Version 10_
//       Program type: Callable routine
//          Main DBMS: Microsoft SqlServer

namespace DeklaritModel {
   using System;
   using System.Reflection;
   using System.Configuration;
   public partial class DynamicDataAdapterFactory : DeklaritModel.IDataAdapterFactory
   {
      private IDataAdapterFactory dataAdapterFactory ;
      public DynamicDataAdapterFactory( Assembly factoryAssembly ,
                                        string factoryClass )
      {
         dataAdapterFactory = ((IDataAdapterFactory)(Activator.CreateInstance( factoryAssembly.GetType( factoryClass, true, false))));
      }

      public DynamicDataAdapterFactory( ) : this(Assembly.LoadFrom(ConfigurationManager.AppSettings["DataAdapterFactory"]), ConfigurationManager.AppSettings["DataAdapterFactoryClass"])
      {
      }

      public DynamicDataAdapterFactory( string typeName )
      {
         dataAdapterFactory = ((IDataAdapterFactory)(Activator.CreateInstance( Type.GetType( typeName, true))));
      }

      public IDataAdapterFactory IDataAdapterFactory
      {
         get {
            return dataAdapterFactory ;
         }

         set {
            dataAdapterFactory = value ;
         }

      }

      public IProductDataAdapter GetProductDataAdapter( )
      {
         return dataAdapterFactory.GetProductDataAdapter( ) ;
      }

      public IPaisDataAdapter GetPaisDataAdapter( )
      {
         return dataAdapterFactory.GetPaisDataAdapter( ) ;
      }

      public IInvoiceDataAdapter GetInvoiceDataAdapter( )
      {
         return dataAdapterFactory.GetInvoiceDataAdapter( ) ;
      }

      public ICiudadDataAdapter GetCiudadDataAdapter( )
      {
         return dataAdapterFactory.GetCiudadDataAdapter( ) ;
      }

      public IClienteDataAdapter GetClienteDataAdapter( )
      {
         return dataAdapterFactory.GetClienteDataAdapter( ) ;
      }

   }

}
